/**
  ******************************************************************************
  * @file    mt006_stimer.h
  * @author  MIC Software Team 
  * @version V1.0.0
  * @date    09/01/2020
  * @brief   This file contains all the functions prototypes for the STIMER firmware 
  *          library.
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, MIC SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * <h2><center>&copy; COPYRIGHT MIC</center></h2>
  ******************************************************************************  
  */ 

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MT006_STIMER_H__
#define __MT006_STIMER_H__

#ifdef __cplusplus
 extern "C" {
#endif


/* Includes ------------------------------------------------------------------*/
#include "mt006.h"

/** @addtogroup MT006_StdPeriph_Driver
  * @{
  */

/** @addtogroup SIMPLE-TIMER
  * @{
  */

/* Exported types ------------------------------------------------------------*/


/** 
  * @brief  STIMER Init structure definition
  */
typedef struct
{
    uint32_t STIMER_Channel;             /*!< Specifies the STIMER channel.
                                            This parameter can be a value of @ref Timer_Channel */

    uint32_t STIMER_Count;               /*!< Specifies the STIMER count.
                                            This parameter can be a value of @ref TIMER_Count */
}STIMER_InitTypeDef;  

/* Exported constants --------------------------------------------------------*/

/** @defgroup STimer_Exported_Constants
  * @{
  */

/** @defgroup STimer_Channel_SWITCH
  * @{
  */
#define STimer_Channel_0                        ((uint32_t)0x00000001)
#define STimer_Channel_1                        ((uint32_t)0x00000002)

#define IS_STIMER_CHANNEL_CONFIG(CHANNEL)      (((CHANNEL) == STimer_Channel_0) || \
                                                ((CHANNEL) == STimer_Channel_1))
/**
  * @}
  */ 

/** @defgroup STimer_Channel_Count
  * @{
  */
#define IS_STIMER_COUNT(COUNT)                  ((COUNT) != 0)
/**
  * @}
  */ 

/**
  * @}
  */ 

/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void STIMER_DeInit(void);
void STIMER_Init(STIMER_InitTypeDef* STIMER_InitStruct);
uint32_t STIMER_GetCurrentValue(uint32_t STimer_Channel);
void STIMER_Cmd(uint32_t STimer_Channel, FunctionalState NewState);
void STIMER_ITConfig(uint32_t STimer_Channel, FunctionalState NewState);
ITStatus STIMER_GetITStatus(uint32_t STimer_Channel);
void STIMER_ClearITPendingBit(uint32_t STimer_Channel);

void STIMER_WriteCountValue(uint32_t STimer_Channel,uint32_t LoadCount);

#ifdef __cplusplus
}
#endif

#endif /*__MT006_TIMER_H */
/**
  * @}
  */ 

/**
  * @}
  */ 

/******************* (C) COPYRIGHT MIC *****END OF FILE****/

